<?php namespace Common\Model;
use Hdphp\Model\Model;

class Orderd extends Model{
    protected $table='orderd';
    protected $auto=array(
        array('ordertime','time','function',3,1),
        array('ordernum','getNum','method',3,1),
        array('shop_user_uid','getUid','method',3,1)
    );
//    获得订单号
    public function getNum(){
        $ordernum=Cart::getOrderId();
        $_SESSION['ordernum']=$ordernum;
        return $ordernum;
    }

    public function getUid(){
        return $useruid=$_SESSION['userinfo']['uid'];
    }
    public function store(){
        if(!$this->create())return false;
        $this->add();
        return true;
    }
}